import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
import vuejs from '@vitejs/plugin-vue-jsx'

// https://vite.dev/config/
export default defineConfig({
  plugins: [vue(),vuejs()],
  resolve: {
    alias: {
      '@': path.resolve(__dirname, 'src'), // 让 @ 代表 src 目录
    },
  },
  server: {
    port: 7070,
    host: "0.0.0.0",
    proxy: {
      '/api': {
        target: 'http://localhost:8180',
        changeOrigin: true,
        rewrite: path => path.replace(/^\/api/, '')
      }
    }
  }
})
